﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAO;
using DTO;
using System.Data;
namespace BUS
{
    public class DatHangBUS
    {
        public int layIDKhachHangMax()
        {
            DatHangDAO dhDAO = new DatHangDAO();
            return dhDAO.layIDKhachHangMax();
        }


        public int layIDHoaDonMax()
        {
            DatHangDAO dhDAO = new DatHangDAO();
            return dhDAO.layIDHoaDonMax();
        }

        public DataTable layBangMatHang()
        {
            DataTable dt;
            DatHangDAO qldhDAO = new DatHangDAO();
            dt = qldhDAO.layBangMatHang();
            return dt;
        }

        public DataTable layTTHoaDon()
        {
            DataTable dt;
            DatHangDAO qldhDAO = new DatHangDAO();
            dt = qldhDAO.layTTHoaDon();
            return dt;
        }
        public DataTable laySPTheoLoai(int loai)
        {
            DataTable dt;
            DatHangDAO qldhDAO = new DatHangDAO();
            dt = qldhDAO.laySPTheoLoai(loai);
            return dt;
        }

        public int themHoaDon(HoaDonDTO hdDTO)
        {
            DatHangDAO dhDAO = new DatHangDAO();
            return dhDAO.themHoaDon(hdDTO);
        }

        public int themKhachHang(KhachHangDTO khDTO)
        {
            DatHangDAO dhDAO = new DatHangDAO();
            return dhDAO.themKhachHang(khDTO);
        }

        public int themChiTietHoaDon(MatHang_DTO mh, int mahd)
        {
            DatHangDAO dhDAO = new DatHangDAO();
            return dhDAO.themChiTietHoaDon(mh,mahd);
        }
       
    }
}
